package com.example.organization;

import com.example.model.Organization;
import com.example.organization.dao.OrganizationRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Component
public class InitData implements CommandLineRunner {
    @Autowired
    private OrganizationRepository organizationRepository;

    @Override
    public void run(String... args) throws Exception {
        Organization organization = new Organization();
        organization.setId(1);
        organization.setName("it");
        organizationRepository.save(organization);
    }
}
